﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Admx_Generator
{
    public class culture:IEquatable<culture>
    {
        private System.Globalization.CultureInfo _cultureInfo;

        public culture(System.Globalization.CultureInfo newCulture)
        {
            try
            {
                _cultureInfo = newCulture;
            }
            catch (Exception) { _cultureInfo = new System.Globalization.CultureInfo("en-US"); }
        }

        public System.Globalization.CultureInfo CultureInfo { get { return _cultureInfo; } set { _cultureInfo = value; } }

        public override string ToString()
        {
            return CultureInfo.DisplayName;
        }

        public bool Equals(culture other)
        {
            if (other == null)
                return false;
            return this.CultureInfo.Equals(other.CultureInfo);
        }

        public override bool Equals(object obj)
        {
            return Equals(obj as culture);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }    
}
